home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 December / MACPOWER-1997-12.ISO.7z / MACPOWER-1997-12.ISO / AMUG / PROGRAMMING / Raven 1.2.sit / Raven 1.2 / Source / Foundation / Common / ZConstants.h < prev    next >
Text File  |  1997-08-23  |  8KB  |  234 lines

  1. /*
  2.  *  File:       ZConstants.h
  3.  *  Summary:       Various constants.
  4.  *  Written by: Jesse Jones
  5.  *
  6.  *  Copyright ゥ 1996-1997 Jesse Jones. 
  7.  *    For conditions of distribution and use, see copyright notice in ZTypes.h  
  8.  *
  9.  *  Change History (most recent first):    
  10.  *
  11.  *         <6>     8/22/97    JDJ        Added kShowInvalidationsCmd.
  12.  *         <5>     6/15/97    JDJ        Added kHelpCmd.
  13.  *         <4>     8/15/97    JDJ        Added kSaveAllCmd and kJunkAllCmd.
  14.  *         <3>     8/15/97    JDJ        Added constants for modifier keys.
  15.  *         <2>     8/06/97    JDJ        Removed kEmptyString, kEmptyPascalString, and kUnknownString.
  16.  *         <1>     1/20/96    JDJ        Created
  17.  */
  18.  
  19. #pragma once
  20.  
  21. #include <ZTypes.h>
  22.  
  23.  
  24. // ===================================================================================
  25. //    Misc Constants
  26. // ===================================================================================
  27. const bool kRedraw     = true;
  28. const bool kDontRedraw = false;
  29.  
  30. const bool kHandled    = true;
  31. const bool kNotHandled = false;
  32.  
  33. const bool kMoveHigh     = true;        
  34. const bool kDontMoveHigh = false;        
  35.  
  36. const bool kPurgeable    = true;
  37. const bool kNonPurgeable = false;
  38.  
  39. const bool kRecursive    = true;
  40. const bool kNonRecursive = false;
  41.  
  42. const bool kPersistant    = true;
  43. const bool kNonPersistant = false;
  44.  
  45. const bool kRaw    = true;
  46. const bool kCooked = false;
  47.  
  48. const short kDontZeroBytes     = 0;
  49. const short kZeroBytes           = 1;
  50. const short kUseAppHeap        = 2;
  51. const short kUseTempHeap       = 4;
  52.  
  53. const Byte kNewFill  = 0xD3;                    // Used for filling new and freed blocks.
  54. const Byte kFreeFill = 0xF3;
  55.  
  56. const short kNoFileRefNum = -32767;
  57. const short kNoResource   = -1;
  58.  
  59. const short kFullJustification = 128;            // This is currently only used by Raven's TextBox function (see ZQuickDrawUtils.h)
  60.  
  61. const bool kUseCase     = true;
  62. const bool kDontUseCase = false;
  63.  
  64. #if MAC
  65.     const bool kIsBigEndian = true;
  66. #elif WIN
  67.     const bool kIsBigEndian = false;
  68. #else
  69.     #pragma error can't set endian
  70. #endif
  71.  
  72.  
  73. // ===================================================================================
  74. //    Character and Key Codes
  75. // ===================================================================================
  76.  
  77. // Navigation Keys
  78. const char  kLeftArrowChar         = 0x1C;
  79. const char  kRightArrowChar     = 0x1D;
  80. const char  kUpArrowChar         = 0x1E;
  81. const char  kDownArrowChar         = 0x1F;
  82.  
  83. const char  kHomeChar             = 0x01;
  84. const char  kEndChar             = 0x04;
  85. const char  kPageUpChar         = 0x0B;
  86. const char  kPageDownChar         = 0x0C;
  87.  
  88. // Deletion Keys
  89. const char  kBackspaceChar         = 0x08;
  90. const char  kFwdDeleteChar         = 0x7F;            // Only nonprinting above $20
  91. const char  kClearChar             = 0x1B;            // Same as Escape
  92. const short kClearKey             = 0x47;
  93.  
  94. // Action Keys
  95. const char  kEnterChar             = 0x03;
  96. const char  kTabChar             = 0x09;
  97. const char  kReturnChar         = 0x0D;
  98. const char  kEscapeChar         = 0x1B;            // Same as Clear
  99. const short kEscapeKey            = 0x35;
  100.  
  101. // Special Keys
  102. const char  kHelpChar             = 0x05;
  103. const char  kFunctionChar         = 0x10;            // All function keys F1 to F15
  104. const short kF1Key                 = 0x7A;            // Undo
  105. const short kF2Key                 = 0x78;            // Cut
  106. const short kF3Key                 = 0x63;            // Copy
  107. const short kF4Key                 = 0x76;            // Paste
  108. const short kF5Key                 = 0x60;
  109. const short kF6Key                 = 0x61;
  110. const short kF7Key                 = 0x62;
  111. const short kF8Key                 = 0x64;
  112. const short kF9Key                 = 0x65;
  113. const short kF10Key             = 0x6D;
  114. const short kF11Key             = 0x67;
  115. const short kF12Key             = 0x6F;
  116. const short kF13Key             = 0x69;            // Print Screen
  117. const short kF14Key             = 0x6B;            // Scroll Lock
  118. const short kF15Key             = 0x71;            // Pause
  119.  
  120. // Special Characters
  121. const char  kCommandChar         = 0x11;            // the cloverleaf symbol
  122. const char    kTildeChar            = 0x7E;
  123. const char  kCheckMarkChar         = 0x12;
  124. const char  kDiamondChar         = 0x13;
  125. const char  kAppleLogoChar         = 0x14;
  126.  
  127. const char  kFirstPrintingChar    = 0x20;            // Nonprinting if less than
  128. const char  kSpaceChar             = 0x20;
  129. const char  kPeriodChar         = 0x2E;            // For detecting Command-Period
  130.  
  131. // Modifier Keys
  132. const short kLeftShiftKey        = 0x38;
  133. const short kRightShiftKey        = 0x3C;
  134. const short kOptionKey            = 0x3A;
  135. const short kCommandKey            = 0x37;
  136. const short kControlKey            = 0x3B;
  137.  
  138.  
  139. // ===================================================================================
  140. //    Messages
  141. //         Note that lower case messages are reserved for Raven.
  142. // ===================================================================================
  143. extern const string kNothingMessage;            
  144.  
  145. extern const string kOKMessage;                    
  146. extern const string kCancelMessage;                
  147.  
  148.  
  149. // ===================================================================================
  150. //    Commands
  151. //         Note that lower case commands are reserved for Raven.
  152. // ===================================================================================
  153. extern const MenuCommand kNothingCmd;
  154. extern const MenuCommand kAbortCmd;                // command-period
  155. extern const MenuCommand kHelpCmd;
  156.  
  157. extern const MenuCommand kAboutCmd;                // About Menu
  158. extern const MenuCommand kDACmd;                
  159.  
  160. extern const MenuCommand kNewCmd;                // File Menu
  161. extern const MenuCommand kOpenCmd;
  162. extern const MenuCommand kCloseCmd;
  163. extern const MenuCommand kCloseAllCmd;
  164. extern const MenuCommand kJunkAllCmd;
  165. extern const MenuCommand kSaveCmd;
  166. extern const MenuCommand kSaveAllCmd;
  167. extern const MenuCommand kSaveAsCmd;
  168. extern const MenuCommand kRevertCmd;
  169. extern const MenuCommand kPageSetupCmd;
  170. extern const MenuCommand kPrintCmd;
  171. extern const MenuCommand kPrintOneCmd;
  172. extern const MenuCommand kQuitCmd;
  173. extern const MenuCommand kSaveCopyAsCmd;
  174.  
  175. extern const MenuCommand kUndoCmd;                 // Edit Menu
  176. extern const MenuCommand kRedoCmd;     
  177. extern const MenuCommand kCutCmd;
  178. extern const MenuCommand kCopyCmd;
  179. extern const MenuCommand kPasteCmd;
  180. extern const MenuCommand kClearCmd;
  181. extern const MenuCommand kSelectAllCmd;
  182. extern const MenuCommand kShowClipboardCmd;
  183.  
  184. extern const MenuCommand kStackWindowCmd;        // Window menu
  185. extern const MenuCommand kTileWindowCmd;
  186. extern const MenuCommand kNextWindowCmd;
  187.  
  188. extern const MenuCommand kFontMenuCmd;            // Sub-menus
  189. extern const MenuCommand kSizeMenuCmd;
  190. extern const MenuCommand kStyleMenuCmd;
  191.  
  192. extern const MenuCommand kFontLargerCmd;         // Size menu commands
  193. extern const MenuCommand kFontSmallerCmd;
  194. extern const MenuCommand kFontOtherCmd;
  195.  
  196. extern const MenuCommand kPlainCmd;             // Style menu commands
  197. extern const MenuCommand kBoldCmd;
  198. extern const MenuCommand kItalicCmd;
  199. extern const MenuCommand kUnderlineCmd;
  200. extern const MenuCommand kOutlineCmd;
  201. extern const MenuCommand kShadowCmd;
  202. extern const MenuCommand kCondenseCmd;
  203. extern const MenuCommand kExtendCmd;
  204.  
  205. extern const MenuCommand kJustifyDefaultCmd;     // Text justification
  206. extern const MenuCommand kJustifyLeftCmd;
  207. extern const MenuCommand kJustifyCenterCmd;
  208. extern const MenuCommand kJustifyRightCmd;
  209. extern const MenuCommand kJustifyFullCmd;
  210.  
  211. #if DEBUG
  212. extern const MenuCommand kTraceFlowCmd;            // Debugging commands
  213. extern const MenuCommand kUnitTestCmd;            
  214.  
  215. extern const MenuCommand kMACSBUGCmd;
  216. extern const MenuCommand kIntenseDebugCmd;
  217. extern const MenuCommand kHeapCheckCmd;
  218. extern const MenuCommand kASSERTCmd;
  219. extern const MenuCommand kShowHeapCmd;
  220. extern const MenuCommand kEatMemoryCmd;
  221. extern const MenuCommand kPurgeMemoryCmd;
  222. extern const MenuCommand kTRACEToSIOUXCmd;
  223. extern const MenuCommand kTRACEToFileCmd;
  224. extern const MenuCommand kTRACEAllToFileCmd;
  225. extern const MenuCommand kMonkeyCmd;
  226. extern const MenuCommand kDoEveryUnitTestCmd;
  227. extern const MenuCommand kShowSIOUXCmd;
  228. extern const MenuCommand kShowInvalidationsCmd;
  229. extern const MenuCommand kFreeDeletedBlocksCmd;
  230. extern const MenuCommand kDumpObjectHeapCmd;
  231. #endif
  232.  
  233.  
  234.